package org.yunmai.config;

import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;


@Configuration
@EnableKnife4j
public class Knife4jConfiguration {

    @Bean(value = "dockerBean")
    public OpenAPI dockerBean(Environment environment) {
        // 构建 OpenAPI 3 文档
        OpenAPI docket = new OpenAPI()
                .info(new Info()
                        .description("# 这是我们的接口文档")
                        .termsOfService("https://doc.xiaominfo.com/")
                        .contact(new Contact())
                        .version("1.0")
                        .title("测试服务 API 文档"));
        return docket;
    }
}
